#!/usr/bin/perl
# authenable.cgi
# trap auth enable module

require 'snmp-lib.pl';


&header($text{'auth_title'}, "", undef, undef, 1);
&ReadParse();

my $keyElem = "authtrapenable";
my $lineEntry;
if($in{checkbox})
{
	$lineEntry = $keyElem." 1";
}
else
{
	$lineEntry = $keyElem." 2";
}

#print $lineEntry;

my $code = &WriteConfFile($keyElem, $lineEntry);

if($code)
{
	print "<b>Failed!</b>";
	&nas_syslog("snmp","naslog_warning",13007,"enable authentication failed!");
}
else
{
	print "<b>Successful!</b>";
	&nas_syslog("snmp","naslog_info",13008,"enable authentication successful!");
}

&footer("/ucd-snmp/",$text{'index_title'});
